﻿
IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[sproc_GetTotalStaff_V2]') AND type in (N'P', N'PC'))
    DROP PROCEDURE [dbo].[sproc_GetTotalStaff_V2];
GO
CREATE PROCEDURE [dbo].[sproc_GetTotalStaff_V2]
/*

====================================================
功能:    得到所有的人员
    
====================================================

*/
AS
BEGIN
SET NOCOUNT ON;

SELECT
		S.*,
		P.Position_ID,
		P.Position_name
    FROM
		dbo.UDS_Staff S
        INNER JOIN dbo.UDS_Staff_In_Position SIP ON S.Staff_ID = SIP.Staff_ID
        INNER JOIN dbo.UDS_Position P ON SIP.Position_ID = P.Position_ID
    ORDER BY
		S.RegistedDate DESC;

END
GO
